#pragma once
#include <QtGui/QWidget>
#include "ui_ZCaiWuWidget.h"
#include "../../ZWuliuSvr/DBOpt/ZDBWuliuCaiwu.h"
#include "../ZWuliuSvr/DBOpt/ZDBWuliuPaiche.h"
class ZDBWuliuPackage;
class ZCaiwuItemCtrl;


class ZCaiWuWidget : public QDialog
{
	Q_OBJECT
public:
	ZCaiWuWidget(QString sCaiwuType, const std::vector<ZDBWuliuPackage>& vecPackages, QWidget *parent = 0, Qt::WFlags flags = 0);
	ZCaiWuWidget(ZDBWuliuPaiche& paiChe, QWidget *parent = 0, Qt::WFlags flags = 0);
	ZCaiWuWidget(ZDBWuliuCaiwu& caiWu, QWidget *parent = 0, Qt::WFlags flags = 0);
	virtual ~ZCaiWuWidget(void);

private slots:
	void _onOkClicked(bool bChecked);		

private:
	void _updateData2Ui();
	void _updateUi2Data();
	QString _getCaiwuCtrl_DBValName(ZCaiwuItemCtrl* pCtrl);

private:
	Ui::ZCaiWuWidgetClass			ui;
	std::vector<ZDBWuliuPackage>	m_vecPackages;
	ZDBWuliuPaiche					m_paiche;
	QString							m_caiwuType;
	ZDBWuliuCaiwu					m_dbCaiwu;
};

